package com.wz.wiki.service.impl;

import com.wz.wiki.entity.resp.StatisticResp;
import com.wz.wiki.mapper.EbookSnapshotMapper;
import com.wz.wiki.service.EbookSnapshotService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 王哲
 * @Contact 1121586359@qq.com
 * @ClassName EbookSnapshotServiceImpl.java
 * @create 2023年07月03日 下午8:23
 * @Description 电子书快照接口实现
 * @Version V1.0
 */
@Service
public class EbookSnapshotServiceImpl implements EbookSnapshotService {

    @Resource
    private EbookSnapshotMapper ebookSnapshotMapper;

    @Override
    public void genSnapshot() {
        ebookSnapshotMapper.genSnapshot();
    }

    /**
     * 获取首页数值数据：总阅读数、总点赞数、今日阅读数、今日点赞数、今日预计阅读数、今日预计阅读增长
     *
     * @return
     */
    @Override
    public List<StatisticResp> getStatistic() {
        return ebookSnapshotMapper.getStatistic();
    }

    /**
     * 30天数值统计
     */
    @Override
    public List<StatisticResp> get30Statistic() {
        return ebookSnapshotMapper.get30Statistic();
    }


}
